/**
 * C Programming: A Modern Approach
 *
 * version: 2nd
 * author: K.N.King
 * http://knking.com/books/c2
 */

#include <stdio.h>

/**
 * Calculate the result of 3*x^5 + 2*x^4 - 5*x^3 - x^2 + 7*x -6
 */

int main(void) {
    float x;
    float result;
    printf("Enter the value of x: ");
    scanf("%f", &x);

    // 3*x^5 + 2*x^4 - 5*x^3 - x^2 + 7*x -6
    result = 3 * x * x * x * x * x + 2 * x * x * x * x - 5 * x * x * x - x * x +
             7 * x - 6;
    printf("The result is: %.2f\n", result);

    return 0;
}

/*
output:
Enter the value of x: 2
The result is: 92.00
*/